package com.car.service.controller;

import com.car.service.websocket.ChatWebSocketServer;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * WebSocket控制器
 */
@RestController
@RequestMapping("/api/chat/ws")
public class WebSocketController {
    
    /**
     * 获取在线人数
     */
    @GetMapping("/online")
    public int getOnlineCount() {
        return ChatWebSocketServer.getOnlineCount();
    }
} 